/**
*      author: Y_Yao
*      created: 2024-10-11 19:02:57
**/

#include<bits/stdc++.h>

using namespace std;
using LL = long long;
const int INF = 0x3f3f3f3f;
const int N = 100 + 9;
int a[N];


void solve()
{
    int n,k;
    cin >> n >> k;
    vector<bool> vis(n,false);

    unordered_map<int,int> hash;
    for(int i = 1;i <= k;i++) hash[i]++;

    int tk = k;
    for(int i = 0;i < n;i++)
    {
        cin >> a[i];
        auto it = hash.find(a[i]);
        if(it != hash.end() && !vis[a[i]])//yes
        {
            vis[a[i]] = true;
            tk--;
        }
    }

    if(tk == 0) cout << "YES" << endl;
    else cout << "NO" << endl;



}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}